<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::post('/getCaptcha', [\App\Http\Controllers\SystemController::class,'getCaptcha']);
Route::post('admin/login', [\App\Http\Controllers\SystemController::class,'login']);
Route::post('user/login', [\App\Http\Controllers\UserController::class,'login']);

Route::any('checkToken',[\App\Http\Controllers\UserController::class,'checkToken']);

Route::post('sys/mapType', [\App\Http\Controllers\SystemController::class,'mapType']);
Route::post('sys/mapLang', [\App\Http\Controllers\SystemController::class,'mapLang']);
Route::post('sys/osSelect', [\App\Http\Controllers\SystemController::class,'osSelect']);
Route::post('sys/listStyle', [\App\Http\Controllers\SystemController::class,'listStyleSelect']);
Route::post('sys/config',[\App\Http\Controllers\SystemController::class,'getConfig']);

Route::post('map/select/game',[\App\Http\Controllers\ManageTypeController::class,'mapGameSelect']);
Route::post('map/select/article',[\App\Http\Controllers\ManageTypeController::class,'mapArticleSelect']);
Route::post('/contact/mail',function(){
    return c_return(0,null);
});


Route::prefix('visitor')->middleware('visitor')->group(function () {
    Route::any('tk',[\App\Http\Controllers\VisitorConsultController::class,'tk']);
    Route::post('game/list/v1',[\App\Http\Controllers\VisitorConsultController::class,'gameListV1']);
    Route::post('game/list/v2',[\App\Http\Controllers\VisitorConsultController::class,'gameListV2']);
    Route::post('game/list/hot',[\App\Http\Controllers\VisitorConsultController::class,'gameListHot']);
    Route::post('game/info',[\App\Http\Controllers\VisitorConsultController::class,'gameInfo']);
    Route::post('article/list/v1',[\App\Http\Controllers\VisitorConsultController::class,'articleListV1']);
    Route::post('article/list/v2',[\App\Http\Controllers\VisitorConsultController::class,'articleListV2']);
    Route::post('article/list/hot',[\App\Http\Controllers\VisitorConsultController::class,'articleListHot']);
    Route::post('article/list/pa',[\App\Http\Controllers\VisitorConsultController::class,'articlePA']);
    Route::post('article/list/top',[\App\Http\Controllers\VisitorConsultController::class,'articleListTop']);
    Route::post('article/info',[\App\Http\Controllers\VisitorConsultController::class,'articleInfo']);
});

Route::any('admin/download/{id}',[\App\Http\Controllers\SystemController::class,'download']);


Route::prefix('admin')
//    ->middleware('authCheck')
    ->group(function () {

    // 重置密码 启用禁用 用户列表 上传文件后解压
    Route::post('register/code',[\App\Http\Controllers\SystemController::class,'getRegisterCode']);
    Route::post('register',[\App\Http\Controllers\SystemController::class,'register']);

    Route::post('upload',[\App\Http\Controllers\SystemController::class,'upload']);
    Route::any('pushGame',[\App\Http\Controllers\SystemController::class,'pushGame']);
    Route::post('carouselImage/set',[\App\Http\Controllers\SystemController::class,'carouselImage']);
    Route::post('game/carouselImage/set',[\App\Http\Controllers\SystemController::class,'setGameCarouseImage']);
    Route::post('game/carouselImage/get',[\App\Http\Controllers\SystemController::class,'getGameCarouseImage']);
    Route::post('listType/set',[\App\Http\Controllers\SystemController::class,'setListStyle']);

    Route::post('map/add',[\App\Http\Controllers\ManageTypeController::class,'mapAdd']);
    Route::post('map/del',[\App\Http\Controllers\ManageTypeController::class,'mapDel']);
    Route::post('map/edit',[\App\Http\Controllers\ManageTypeController::class,'mapEdit']);
    Route::post('map/list/game',[\App\Http\Controllers\ManageTypeController::class,'mapGameList']);
    Route::post('map/list/article',[\App\Http\Controllers\ManageTypeController::class,'mapArticleList']);

    Route::post('article/add',[\App\Http\Controllers\ManageConsultController::class,'articleAdd']);
    Route::post('article/list',[\App\Http\Controllers\ManageConsultController::class,'articleList']);
    Route::post('article/info',[\App\Http\Controllers\ManageConsultController::class,'articleInfo']);
    Route::post('article/del',[\App\Http\Controllers\ManageConsultController::class,'articleDel']);
    Route::post('article/edit',[\App\Http\Controllers\ManageConsultController::class,'articleUpdate']);
    Route::post('article/enable',[\App\Http\Controllers\ManageConsultController::class,'articleEnable']);
    Route::post('article/disable',[\App\Http\Controllers\ManageConsultController::class,'articleDisable']);
    //
    Route::post('article/hot',[\App\Http\Controllers\ManageConsultController::class,'articleHot']);
    Route::post('article/cancelHot',[\App\Http\Controllers\ManageConsultController::class,'articleCancelHot']);
    Route::post('article/top',[\App\Http\Controllers\ManageConsultController::class,'articleTop']);
    Route::post('article/cancelTop',[\App\Http\Controllers\ManageConsultController::class,'articleCancelTop']);

    Route::post('game/add',[\App\Http\Controllers\ManageConsultController::class,'gameAdd']);
    Route::post('game/list',[\App\Http\Controllers\ManageConsultController::class,'gameList']);
    Route::post('game/info',[\App\Http\Controllers\ManageConsultController::class,'gameInfo']);
    Route::post('game/del',[\App\Http\Controllers\ManageConsultController::class,'gameDel']);
    Route::post('game/edit',[\App\Http\Controllers\ManageConsultController::class,'gameUpdate']);
    Route::post('game/enable',[\App\Http\Controllers\ManageConsultController::class,'gameEnable']);
    Route::post('game/disable',[\App\Http\Controllers\ManageConsultController::class,'gameDisable']);
});
